(function(){

    //var BASE_DIR = "http://kjirou.sakura.ne.jp/cgi-bin/ore-bookmark/";
    var BASE_DIR = "{*$WWW_BASE_DIR*}";
    var OBM_IFRAME_CONTAINER_ID = "obm_iframe_container";
    var OBM_IFRAME_ID = "obm_iframe";
    var OBM_SCRIPT_TAG_ID = "obm_script_tag";

    var container = document.getElementById(OBM_IFRAME_CONTAINER_ID);
    var script = document.getElementById(OBM_SCRIPT_TAG_ID);
    var iframe = document.getElementById(OBM_IFRAME_ID);

    if (container === null) {
        var div = document.createElement("div");
        div.id = OBM_IFRAME_CONTAINER_ID;
        div.style.position = "absolute";
        div.style.top = "0px";
        div.style.left = "0px";
        div.style.zIndex = "1000000";
        div.style.margin = "0";
        div.style.padding = "0";
        div.style.height = "100%";
        div.style.width = "100%";
        div.style.overflow = "hidden";
        html  = '<iframe id="' + OBM_IFRAME_ID + '" ';
        html += 'charset="UTF-8" src="' + BASE_DIR + 'get_src.cgi?src_name=iframe.html&' + (new Date).getTime();
        html += '&login_id=' + encodeURIComponent(script._i);
        html += '&login_password=' + encodeURIComponent(script._p);
        html += '&url=' + encodeURIComponent(document.URL);
        html += '&title=' + encodeURIComponent(document.title);
        html += '" '
        html += 'style="border:none;width:100%;height:100%;" ';
        html += 'frameborder="0" allowtransparency="true" scrolling="no"></iframe>';
        div.innerHTML = html;
        document.body.appendChild(div);
    } else {
        if (container.style.display !== "none") {
            container.style.display = "none";
        } else {
            container.style.display = "inline";
        };
    };
    document.body.removeChild(script);
})();

